﻿using Microsoft.WindowsAzure.ServiceRuntime;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;

namespace UserSessionService.WebApi.DataLayer
{
    public class Helper
    {
        public static string GetAppSetting(string configName)
        {
            if (RoleEnvironment.IsAvailable)
                return RoleEnvironment.GetConfigurationSettingValue(configName);

            else
                return ConfigurationManager.AppSettings[configName];
        }
        public static string GetConnectionString(string configName)
        {
            if (RoleEnvironment.IsAvailable)
                return RoleEnvironment.GetConfigurationSettingValue(configName);

            else
                return ConfigurationManager.ConnectionStrings[configName].ConnectionString;
        }
    }
}